﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TasksModel
{
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://mp.tasks.com/2010/")]
    public abstract class NamedObject : IdentifiedObject
    {
        private string _name;

        public string Name
        {
            [System.Diagnostics.DebuggerStepThrough]
            get { return _name; }
            set
            {
                if (!object.ReferenceEquals(_name, value))
                {
                    _name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }

        /// <summary>
        /// Return Name
        /// </summary>
        /// <returns></returns>
        [System.Diagnostics.DebuggerStepThrough]
        public override string ToString()
        {
            return _name != null ? _name : base.ToString();
        }
    }
}